#!/bin/ksh
#--------------------------------------------------------------
# Script Name : Start the Informatica,DAC,and BIEE 
# Created by  : hartlen
#         on  : 2009.10.15
# Updated by  : 
#         on  : 
# Parameters  : 
# Return Code : 0   = Normal End
# Comments    : 
#--------------------------------------------------------------
PATH=$PATH:/home/oracle/scripts ; export PATH
LOG=/tmp/startapp.log
MSG_LOG=/oracle/newbackup/log/joblog_`date +%Y%m`.log ;export MSG_LOG
JOBNAME=Start_APP          ; export JOBNAME

RC_CHK()
{
RC=$1
NAME=$2
if [[ $RC != 0 ]]
  then
      MSG_JOB E "Start $NAME Failure"
      #exit 1
  else
      MSG_JOB I "Start $NAME successfully"
fi
}

MSG_JOB S 

#-----------------------------
#Start Infomatica
#-----------------------------
#export LANG=C
/oracle/app/Informatica/PowerCenter8.1.1/server/tomcat/bin/infaservice.sh startup >$LOG 2>&1
RC=$?; RC_CHK $RC "Informatica"
sleep 180

#-----------------------------
#Start Oc4j 
#-----------------------------
cd /oracle/app/OracleBI/setup
nohup ./oc4j -start >>$LOG 2>&1  &
RC=$?; RC_CHK $RC "OC4J"
sleep 180

#-----------------------------
#Start BIEE
#-----------------------------
/oracle/app/OracleBI/setup/run-sa.sh start >>$LOG 2>&1 
RC=$?; RC_CHK $RC "BIEESA"
sleep 180
/oracle/app/OracleBI/setup/run-saw.sh start >>$LOG 2>&1
RC=$?; RC_CHK $RC "BIEESAW"
sleep 180

#-----------------------------
#Start DAC
#-----------------------------
cd /oracle/app/DAC
nohup ./startserver.sh >>$LOG 2>&1 &
RC=$?; RC_CHK $RC "DAC"

MSG_JOB N
